package game;

import java.awt.*;

public class Meteor {
    private int x, y, width, height, speed;

    public Meteor(int x, int y, int width, int height, int speed) {
        this.x = x; this.y = y;
        this.width = width; this.height = height;
        this.speed = speed;
    }

    public void fall() {
        y += speed;
    }

    public void draw(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        GradientPaint gradient = new GradientPaint(x, y, Color.DARK_GRAY, x + width, y + height, Color.LIGHT_GRAY);
        g2d.setPaint(gradient);
        g2d.fillOval(x, y, width, height);
    }


    public Rectangle getBounds() {
        return new Rectangle(x, y, width, height);
    }

    public int getY() {
        return y;
    }
}
